package com.mdhw.controller;

import com.mdhw.admin.service.AdminUserService;
import com.mdhw.admin.vo.AdminUserVo;
import com.mdhw.common.annotation.AdminSysLog;
import com.mdhw.common.annotation.AvoidRepeatableCommit;
import com.mdhw.common.annotation.IgnorePermissions;
import com.mdhw.config.R;
import com.mdhw.guanlin.vo.GuanUserVo;
import com.mdhw.mili.service.MiliService;
import com.mdhw.mili.vo.user.TokenSociVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Slf4j
@RestController
@Api(tags = "用户相关")
@RequestMapping("adminUser")
public class AdminUserController {


    @Autowired
    private AdminUserService adminUserService;


    /**
     * 后台用户登录
     * @param adminUserVo
     * @return
     */
    @AdminSysLog(moduleName = "后台用户模块",moduleValue = "后台用户登录")
    @IgnorePermissions
    @PostMapping("/login")
    @AvoidRepeatableCommit(timeout = 3)
    public R<AdminUserVo> login(@RequestBody AdminUserVo adminUserVo){
        return this.adminUserService.login(adminUserVo);
    }

}
